<admintpl file="header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:U('user/index')}">{:L('ADMIN_USER_INDEX')}</a></li>
        <li class="active"><a href="{:U('user/add')}">{:L('ADMIN_USER_ADD')}</a></li>
    </ul>
    <form method="post" class="form-horizontal js-ajax-form" action="{:U('User/add_post')}">
        <fieldset>
            <div class="control-group">
                <label class="control-label">{:L('USERNAME')}</label>
                <div class="controls">
                    <input type="text" name="user_login">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">{:L('PASSWORD')}</label>
                <div class="controls">
                    <input type="password" name="user_pass">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">{:L('MOBILE')}</label>
                <div class="controls">
                    <input type="number" name="mobile">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">{:L('ROLE')}</label>
                <div class="controls">
                    <foreach name="roles" item="vo">
                        <label class="checkbox inline"><input value="{$vo.id}" type="checkbox" name="role_id[]"
                            <if condition="sp_get_current_admin_id() neq 1 && $vo['id'] eq 1">disabled="true"</if>
                            >{$vo.name}</label>
                    </foreach>
                </div>
            </div>
            <volist name="campus" id="vo">
                <div class="control-group">
                    <label class="control-label">{$vo.title}</label>
                    <div class="controls">
                        <volist name="building" id="item">
                            <eq name="vo.id" value="$item.campus_id">
                                <label class="checkbox inline"><input value="{$item.id}" type="checkbox"
                                                                      name="building_id[]">{$item.title}</label>
                            </eq>
                        </volist>
                    </div>
                </div>
            </volist>
        </fieldset>
        <div class="form-actions">
            <button type="submit" class="btn btn-primary js-ajax-submit">{:L('ADD')}</button>
            <a class="btn" href="javascript:history.back(-1);">{:L('BACK')}</a>
        </div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>